﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Framework.Security;

namespace Test.Framework.Security
{
    /// <summary>
    /// Summary description for UnitTest1
    /// </summary>
    [TestClass]
    public class TestEntity
    {
        [TestMethod]
        public void TestUserForCreate()
        {
            User user = new User();
            Guid id = Guid.NewGuid();
            user.ID = id;
            user.CreateDate = DateTime.Parse("2009-01-01");
            user.LastActiveTime = DateTime.Parse("2009-01-02"); ;
            user.Password = "pwd";
            user.Status = "1";
            user.UserName = "userName";
            Assert.AreEqual(user.CreateDate, DateTime.Parse("2009-01-01"));
            Assert.AreEqual(user.LastActiveTime, DateTime.Parse("2009-01-02"));
            Assert.AreEqual(user.ID, id);
            Assert.AreEqual(user.Password, "pwd");
            Assert.AreEqual(user.Status, "1");
            Assert.AreEqual(user.UserName, "userName");
        }

        [TestMethod]
        public void TestUserGroupForCreate()
        {
            UserGroup userGroup = new UserGroup();
            Guid id = Guid.NewGuid();
            userGroup.ID = id;
            userGroup.Name = "groupName";
            userGroup.GroupType = "groupType";
            Assert.AreEqual(userGroup.ID, id);
            Assert.AreEqual(userGroup.Name, "groupName");
            Assert.AreEqual(userGroup.GroupType, "groupType");
        }
    }
}
